/**
 * @author attilax 老哇的爪子
	@since  o92 j_48_u$
 */
package com.attilax.ioc;
import aaaCfg.IocX4jobus;

import com.attilax.core;
import com.attilax.db.DBX;
import com.attilax.db.DbxMybatis;
import com.attilax.hre.UrlDslParser;
import com.attilax.persistence.HbxX;
import com.attilax.persistence.PX;
//import com.focustar.ServiceLoctor4vod;
//import com.focustar.downtask.GvDownloadTaskSvs;
import com.google.inject.Binder;
import com.google.inject.Guice;
import com.google.inject.Injector;
import com.google.inject.Module;
import com.google.inject.name.Names;

import static  com.attilax.core.*;

import java.util.*;
import java.net.*;
import java.io.*;

import org.apache.commons.lang3.reflect.MethodUtils;
//import org.directwebremoting.extend.AbstractCreator;
//import org.directwebremoting.extend.Creator;
/**
 * @author  attilax 老哇的爪子
 *@since  o92 j_48_u$
 */
public class IocXq214   {
//	public	static Injector ati;
	
 
	public static void main(String[] args) {
		System.out.println("");
		System.setProperty("apptype","jobus");
	 	UrlDslParser bean = getBean(UrlDslParser.class);
		
	 	System.out.println(bean);
	 	System.out.println(IocX4jobus.getBean(UrlDslParser.class)); //  ok
		
	//	System.out.println(	IocXq214.getBean(UrlDslParser.getClass()));
	}
	/**
	@author attilax 老哇的爪子
		@since  o92 j_48_40   
	
	 * @param class1
	 * @return
	 */
	public  static  <t> t getBean(Class<t> class1) {
		
		 String apptype=System.getProperty("apptype");
		 String clsName="aaaCfg.IocX4@app@".replace("@app@", apptype);
	Object o=	 com.attilax.reflect.MethodUtils.invokeStaticMethod(clsName, "getBean", (Object)class1);
		// attilax 老哇的爪子  j_48_40   o92 
		 
				
		return    (t) o;
		
	}
	//  attilax 老哇的爪子 j_48_u   o92   
	/* (non-Javadoc)
	 * @see org.directwebremoting.extend.Creator#getType()
	 * @author  attilax 老哇的爪子
	 *@since  o93 l_d_c$
	 */
  
	/**
	@author attilax 老哇的爪子
		@since  o02 4_f_56   
	
	 * @param string
	 */
	public     <t> t getBean(String className) {
		// attilax 老哇的爪子  4_f_56   o02 
		try {
			Class c=Class.forName(className);
			return (t) getBean(c);
		} catch (ClassNotFoundException e) {
			//  attilax 老哇的爪子 4_h_t   o02   
			e.printStackTrace();
			throw new RuntimeException(e);
		}
	//	return null;
		
	}
}

//  attilax 老哇的爪子